<!--********************* Part1:Jsp Head *********************-->

<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>  
<%@ include file="/framework/head.jsp"%>

<!--********************* Part2:Java Code *********************-->
<%
	ProductTypeManagerSearchEvent event = (ProductTypeManagerSearchEvent)context.getSessionValue("ProductTypeManagerSearchEvent");
	ObjectList list = ProductTypeManager.fetch().search(con,event);
%>

<!--********************* Part3:JavaScript Code ***************-->
<!--start 客户端脚本区域-->
<script language=javascript>

var list_code = "listProductTypeManager";

function doSearch()
{
	SetValue("s_ProductType",GetValue("i_PRODUCT_TYPE")); //编码

	SetValue("s_TypeName",GetValue("i_TYPE_NAME")); //名称

 	SetValue("s_Status", GetValue("i_Status"));
	//SetValue("s_OrderField",GetValue("i_OrderField")); //排序
	//SetValue("s_OrderDesc",getCheckBoxValues("i_OrderDesc")); //升降序
	
	SetValue("s_UpperType", GetValue("i_UpperType"));
	doCommonSearch();
}

function bizViewProductTypeManager(id)
{
	viewWin("<%=Config.getSrv()%>?action_code=viewProductTypeManager&Id="+id);
}

function doDelete()
{
	if(!hasChooseRadio("ids"))
	{
		bizMessage("删除","t_product_type_manager");
		return false;
	}
	if(!bizConfirm("删除","t_product_type_manager")) return false;
	SetAction("deleteProductTypeManager");
	frm.submit();
}

function doToAdd()
{
	SetAction("toAddProductTypeManager");
	frm.submit();
}

function doToUpdate()
{
	if(!checkOne("ids")) 
	{
		bizMessage("修改","产品统计分类管理");
		return false;
	}
	SetValue("Id",getCheckBoxValue("ids"));
	SetValue("Id",getCheckBoxValue("ids"));
	SetAction("toUpdateProductTypeManager");
	frm.submit();
}
function doToCopy()
{
	if(!checkOne("ids")) 
	{
		bizMessage("复制","t_product_type_manager");
		return false;
	}
		alert(123);
	
	SetAction("toCopyProductTypeManager");
	frm.submit();
}

key_InitDefault();
key_RegSubmitHandler(doSearch);
</script>


<%=uiBody%>>

<!--********************* Part4:Form  ***************-->
<form id=frm action="<%=Config.getSrv()%>" method="post">
<input type=hidden name="action_code" value="">
<input type=hidden name="Id" value="">
<input type=hidden name=sortOrder value="1">

<!--查询条件保留区域-->
<input type=hidden name="s_ProductType" value="<%=event.getProductType()%>"> <!--编码-->

<input type=hidden name="s_TypeName" value="<%=event.getTypeName()%>"> <!--名称-->

<input type=hidden name="s_Status" value="<%=event.getStatus()%>"> <!--单据状态-->

<input type=hidden name="s_UpperType" value="<%=event.getUpperType()%>">
<%@ include file="/framework/list_head.jsp"%>


<!--********************* Part5:Search Area ***************-->
<%=uiSearchStart%>>
<%
	int key_tab = 1 ;
%>
<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			分类编码：
			<input type="text" class="texts" name="i_PRODUCT_TYPE" size="20" value="<%=event.viewProductType()%>" key_tab="<%=key_tab++%>">
			&nbsp;&nbsp;分类名称：
			<input type="text" class="texts" name="i_TYPE_NAME" size="20" value="<%=event.viewTypeName()%>" key_tab="<%=key_tab++%>">
		</td>
</tr>
<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			状态：&nbsp;&nbsp;;&nbsp; <%=SelectManager.viewValidOrNoSelect("i_Status",event.viewStatus(),true,"",SelectManager.SELECT_ALL,"","key_tab="+(key_tab++))%>
			&nbsp;&nbsp;
			上级分类：<select name = "i_UpperType">
						<option value="">全部</option>
						<% 
							Conditions condition = new Conditions();
							condition.add(" upper_type ='0' and status = 1");
							ObjectList productTypeList = ProductTypeManager.fetch().search(con,condition);
							for(int i = 0 ; i<productTypeList.size();i++ ){
							ProductTypeManagerBase manager = (ProductTypeManagerBase)productTypeList.get(i);
						%>
						<option value="<%=manager.getProductType() %>" <%if(manager.getProductType().equals(event.getUpperType())){%>selected<%} %>><%=manager.getTypeName() %></option>
						<%} %>
					</select>
		</td>
	</tr>


	<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			<!-- <select name="i_OrderField">
				<option value="" <%=(event.getOrderField().equals("1"))?"selected":""%>>设置排序字段</option>
				<option value="Type" <%=(event.getOrderField().equals("Type"))?"selected":""%>>编码</option>
				
				<option value="TypeName" <%=(event.getOrderField().equals("TypeName"))?"selected":""%>>名称</option>
			</select>
			
			&nbsp;&nbsp;
			<input type="radio" name="i_OrderDesc" value="false" <%=(event.isOrderDesc()==false)?"checked":""%> >升序
			<input type="radio" name="i_OrderDesc" value="true"  <%=(event.isOrderDesc()==true)?"checked":""%>  >降序
			-->
			<input type="button" value="查询" class="buttons" onclick="doSearch();return false;">&nbsp;<input type="button" value="清空" class="buttons" onclick="doClearEvent();return false;">
		</td>
	</tr>

<%=uiSearchEnd%>

<!--列表标题-->
<%=UIManager.addListHeadTitle("产品分类供应商列表")%>

<!--********************* Part6:List Area ***************-->

<%=uiListStart%>>

<%@ include file="/framework/list_foot.jsp"%>

<%
	int index = 1 ;
%>	
	<%=uiListHeadTR%>>
		<%=UIManager.addListHeadCheckBox() %>

		<%=UIManager.addListHead("分类编码",index++)%>

		<%=UIManager.addListHead("分类名称",index++)%>
		
		<%=UIManager.addListHead("父类编码",index++)%>

		<%=UIManager.addListHead("备注",index++)%>

		<%=UIManager.addListHead("最后修改人",index++)%>

		<%=UIManager.addListHead("最后修改时间",index++)%>

	<%=uiListHeadTREnd%>>
	
	<!--data-->
<%
	for(int i=0;i<list.size();i++)
	{
		ProductTypeManager obj = (ProductTypeManager)list.get(i);
%>
	<%=uiListDataTR[i%2]%> align=center>
    	<%=uiListDataTD%>>
    		<input type="checkbox" name="ids" value="<%=obj.getId()%>">
    	</td>
    	
    	<%=uiListDataTD%>><%=obj.viewProductType(con)%></td>
    
    	<%=uiListDataTD%>><%=obj.viewTypeName(con)%></td>
    	
    	<%=uiListDataTD%>><%=obj.viewUpperType(con)%></td>
    
    	<%=uiListDataTD%>><%=obj.viewRemark(con)%></td>

    	<%=uiListDataTD%>><%=obj.viewLastUpdateUser(con)%></td>
    
    	<%=uiListDataTD%>><%=obj.viewLastUpdateTime(con)%></td>
        

  	</tr>
<%	
	}
%>  

<%@ include file="/framework/list_foot2.jsp"%>

<%=uiListEnd%>


<!--********************* Part7:Action Area ***************-->
<%=uiCommandStart%>>
	<%=uiCommandTR%>>
		<%=uiCommandTD%>>
		<input type=button value="    添加   " class="buttons" onclick="doToAdd();return false;">
		<input type=button value="    修改   " class="buttons" onclick="doToUpdate();return false;">
		</td>
	</tr>	
<%=uiCommandEnd%>
</form>


<%@ include file="/framework/foot.jsp"%>
